from django.urls import path
from .views import (
    CommunityPostListView, user_profile, LocationView, 
    VideoRecommendView, CourseContentView, SearchView, 
    SearchSuggestionView, SearchHotwordsView, AgentSearchView,
    CommentListCreateView, LikeView, UnlikeView,
    UploadView, DeleteCommunityPostView, RecommendListView,
    PersonalizedRecommendView, VideoViewRecordView
)
from django.conf import settings
from django.conf.urls.static import static
from . import views
from home.views import BilibiliImageProxyView

urlpatterns = [
    path('api/community/posts/', CommunityPostListView.as_view()),
    path('api/community/comments/', CommentListCreateView.as_view()),
    path('api/community/like/', LikeView.as_view()),
    path('api/community/unlike/', UnlikeView.as_view()),
    path('api/upload', UploadView.as_view()),
    path('api/user/profile', user_profile),
    path('location/', LocationView.as_view()),
    path('api/video_recommend/', VideoRecommendView.as_view()),
    path('api/course_content/', CourseContentView.as_view()),
    
    # 搜索相关路由
    path('api/search/', SearchView.as_view(), name='search'),
    path('api/search/suggestions/', SearchSuggestionView.as_view(), name='search_suggestions'),
    path('api/search/hotwords/', SearchHotwordsView.as_view(), name='search_hotwords'),
    path('api/agent_search/', AgentSearchView.as_view(), name='agent_search'),
    path('api/get_realtime_location/', views.get_realtime_location, name='get_realtime_location'),
    path('delete_post/', DeleteCommunityPostView.as_view(), name='delete_post'),
    path('api/recommend/', RecommendListView.as_view(), name='recommend'),
    path('api/bili_img_proxy/', BilibiliImageProxyView.as_view(), name='bili_img_proxy'),
    path('api/personalized_recommend/', PersonalizedRecommendView.as_view(), name='personalized_recommend'),
    path('api/video_view_record/', VideoViewRecordView.as_view(), name='video_view_record'),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)